<?php

// ****** 一些木马的[IP]禁止 ******
$disIPList = '';
if (file_exists('./disable_IP.txt')) {
    $disIPList = file_get_contents('./disable_IP.txt');
}
$disIPList = explode(",\n", $disIPList);
$ip = $_SERVER['REMOTE_ADDR'];
if (1==2&&!empty($ip) && in_array($ip, $disIPList)) {
    header("HTTP/1.0 404 Not Found");
    return false;
}

require __DIR__ . '/../vendor/autoload.php';
// Environment
Dotenv\Dotenv::createMutable(dirname(__DIR__), '.env')->load();

// 是否开启Debugger
//$openDebug = empty($_GET['wpj']) ? false : true;
$openDebug = $_SERVER['debugger'];
// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', $openDebug);
defined('YII_ENV') or define('YII_ENV', $openDebug ? 'dev' : 'prod');

require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
$config = require __DIR__ . '/../config/web.php';
(new yii\web\Application($config))->run();

?>
